package com.school.system.controller;

import com.school.system.vo.Result;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.time.LocalDateTime;
import java.util.HashMap;
import java.util.Map;

/**
 * 测试控制器
 * 
 * @author 鹿与兔
 * @since 2025-05-22
 */
@RestController
@RequestMapping("/test")
@CrossOrigin
public class TestController {

    /**
     * 健康检查
     */
    @GetMapping("/health")
    public Result<Map<String, Object>> health() {
        Map<String, Object> data = new HashMap<>();
        data.put("status", "UP");
        data.put("timestamp", LocalDateTime.now());
        data.put("message", "教务管理系统运行正常");
        return Result.success(data);
    }

    /**
     * 系统信息
     */
    @GetMapping("/info")
    public Result<Map<String, Object>> info() {
        Map<String, Object> data = new HashMap<>();
        data.put("name", "教务管理系统");
        data.put("version", "1.0.0");
        data.put("author", "鹿与兔");
        data.put("description", "基于SpringBoot的教务管理系统");
        return Result.success(data);
    }
}
